package router

import (
	"databureau/debugLog"
	"databureau/middleware"
	"databureau/service"

	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	debugLog.InitFile("logrus_study/gin_logrus/logs", "server")
	r := gin.New()
	r.Use(middleware.LogMiddleware())
	apiV1 := r.Group("/api/v1")
	{
		apiV1.GET("/getNearlyHalf", service.GetNearlyHalf)
		apiV1.GET("/getOneMachineCountry", service.GetOneMachineCountry)
		apiV1.GET("/getNearlyBjl", service.GetNearlyBjl)
		apiV1.GET("/getTaskNum", service.GetTaskNum)
		apiV1.GET("/getCountryQhInfo", service.GetCountryQhInfo)
		apiV1.GET("/getCountLegalPersonData", service.GetCountLegalPersonData)
		apiV1.GET("/getCenterTaskTypeQhCount", service.GetCenterTaskTypeQhCount)

		apiV1.POST("/getPositionAndDate", service.GetPositionAndDate)
		apiV1.POST("/getTaskByShenpilb", service.GetTaskByShenpilb)
		apiV1.GET("/getXzxkPercent", service.GetXzxkPercent)

		apiV1.POST("/getWjzjHotTop5", service.GetWjzjHotTop5)
		apiV1.POST("/getWjzjHotTop5Detail", service.GetWjzjHotTop5Detail)
		apiV1.POST("/getHotTaskTop5", service.GetHotTaskTop5)
		apiV1.POST("/getHotTaskTop5Detail", service.GetHotTaskTop5Detail)
		apiV1.POST("/getCangoRegionList", service.GetCangoRegionList)
		apiV1.POST("/getTaskAndCount", service.GetTaskAndCount)

		apiV1.POST("/getYtjcountTown", service.GetYtjcountTown)
		apiV1.POST("/getYtjcount", service.GetYtjcount)
		apiV1.POST("/getCenterTaskTypeQhCountByAreaCode", service.GetCenterTaskTypeQhCountByAreaCode)

		apiV1.POST("/getzqinfoList", service.GetzqinfoList)
		apiV1.POST("/getzqList", service.GetzqList)
	}
	return r
}
